﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Caliburn;
using Caliburn.Modules;
using Caliburn.Services;
using NServiceBus.Management.Modules;
using NServiceBus.Management.Shell;
using Caliburn.StateManagement;

namespace NServiceBus.Management.Shell
{
    /// <summary>
    /// Interaction logic for ShellWindow.xaml
    /// </summary>
    public partial class ShellWindow : Window
    {
        private EndpointExplorerModule endpointExplorer;
        private EndpointExplorerCommandMenuModule endpointCommandMenu;

        public ShellWindow()
        {
            InitializeComponent();

            //endpointExplorer = DI.Resolve<EndpointExplorerModule>();
            //endpointCommandMenu = DI.Resolve<EndpointExplorerCommandMenuModule>();
        }

        //public Main()
        //{
        //    InitializeComponent();



        //}

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            DI.Resolve<IShellState>().Load();
            DI.Resolve<IModuleManager>().RefreshModules();
        }

        private void Window_Closing(object sender, CancelEventArgs e)
        {
            DI.Resolve<IShellState>().Save();
        }
    }
}
